package bishihuizong;

import java.util.Scanner;

/**
 * Created by JiaJia on 2019/9/16 0016.
 */
public class Kuaishou01 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String input=scanner.nextLine();
            System.out.println(isValid(input));
        }scanner.close();
    }
    private static String isValid(String ip){
        if (ip==null){
            return "Neither";
        }
        String regex0="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
        String regexipv4=regex0+"(\\."+regex0+"){3}";
        String regex1="([\\da-fA-F]{1,4})";
        String regexipv6=regex1+"(:"+regex1+"){7}";

        String result="Neither";
        if (ip.matches(regexipv4)){
            result="IPv4";
        }else if (ip.matches(regexipv6)){
            result="IPv6";
        }
        return result;
    }
}